<?php
namespace Common\Model;
use Think\Model;
// +----------------------------------------------------------------------
// | Date:2017年2月28日
// +----------------------------------------------------------------------
// | Author: EK_熊<1439527494@qq.com>
// +----------------------------------------------------------------------
// | Description: 此文件作用于****
// +----------------------------------------------------------------------
class MessageModel extends Model{
    
    
    function count_unread($sn){
        $ret = $this->where(['to_sn'=>$sn,'isread'=>0])->count();
        return $ret;
    }
    
    
    function read_all($sn){
        return $this->where(['to_sn'=>$sn,'isread'=>0])->setField('isread',1);
    }
}